package com.kitty.game.map;

import com.kitty.game.role.model.Role;
import com.kitty.game.config.GameMap;
import com.kitty.game.config.Transfer;
import com.kitty.game.utils.Const;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

public class MapDataPool {

    /**key:地图ID value:GameMap地图对象*/
    public static Map<Integer, GameMap> id2GameMaps;

    /**key:地图名称 value:地图ID*/
    public static Map<String, Integer> mapName2Id;

    /**key:地图ID value:传送点ID集合*/
    public static Map<Integer, HashSet<Short>> mapId2TrasferIdSet;

    /**key:传送点id value:传送点信息*/
    public static Map<Short, Transfer> trasferId2Trasfer;

    /**按职业显示地图，同一职业才显示*/
    public static Set<Integer> polarMaps;

    /**key: mapId, value: 获得对应分组key的方法*/
    public static Map<Integer, Function<Role, Serializable>> MAP_KEY_GENERATERS = new ConcurrentHashMap<>();

    /**不能切换的地图列表*/
    public static Set<Integer> NOT_CHANGE_MAPS = new HashSet<>();

    static {
        polarMaps = new HashSet<>();
        /**证道殿地图只显示同一职业*/
        polarMaps.add(29002);

        NOT_CHANGE_MAPS.add(Const.SHIDAO_MAPID);
        NOT_CHANGE_MAPS.add(Const.DIFU_SHIDAO_MAPID);
    }
}
